package com.apps.ftapp.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Lly on 2017/10/11.
 */

public class Singleton {

    /* 持有私有静态实例，防止被引用，此处赋值为null，目的是实现延迟加载 */
    private static Singleton instance = null;


    private List<Map> selList = new ArrayList<>();
    private List<String> titList = new ArrayList<>();


    private Map yiji = new HashMap();
    private Map erji = new HashMap();
    private Map sanji = new HashMap();


    private String category;

    public List<Map> getSelList() {
        return selList;
    }

    public void setSelList(List<Map> selList) {
        this.selList = selList;
    }

    public void addMap(Map map) {
        this.selList.add(map);
    }

    public void clearMap() {
        this.selList.clear();
    }

    public void clearTit() {
        this.titList.clear();
    }

    public List<String> getTitList() {
        return titList;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public void setTitList(List<String> titList) {
        this.titList = titList;
    }

    public void setTit(String tit) {
        this.titList.add(tit);
    }


    public Map getYiji() {
        return yiji;
    }

    public void setYiji(Map yiji) {
        this.yiji = yiji;
    }

    public Map getErji() {
        return erji;
    }

    public void setErji(Map erji) {
        this.erji = erji;
    }

    public Map getSanji() {
        return sanji;
    }

    public void setSanji(Map sanji) {
        this.sanji = sanji;
    }

    /* 私有构造方法，防止被实例化 */
    private Singleton() {
    }

    /* 1:懒汉式，静态工程方法，创建实例 */
    public static Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }

}
